/**
 * time: 2025-09-16
 * author: XJ
 * description: 产品基本信息页面
 */

import { CheckCircleOutlined, CloseCircleOutlined, InboxOutlined, SyncOutlined, UploadOutlined } from '@ant-design/icons';
import { useModel } from '@umijs/max';
import { Button, Cascader, Checkbox, DatePicker, Divider, Form, Input, InputNumber, message, Modal, Popconfirm, Rate, Row, Select, Space, Steps, TreeSelect, Upload } from 'antd';
import { Col } from 'antd/lib';
import TextArea from 'antd/es/input/TextArea';
import condition from '@/components/staticFile/treeSelect.json';
import { useEffect, useState } from 'react';
const COMMON_FIELD_STYLE = { width: '100%', height: 40, borderRadius: 4 };
import dayjs from 'dayjs';
import { govermentAuditProduct, updateProduct } from '@/services/apis/serviceProviderRegister';
import { filePreview, govermentAuditProgram, programCheck, updateProgram, updateProgramCheck, uploadFile } from '@/services/apis/companyRegister';
const FORM_LAYOUT = {
    labelCol: { span: 6 }, // 调整标签宽度，避免长标签换行
    wrapperCol: { span: 18 },
    layout: 'horizontal' as const,

    size: 'middle' as const, // 统一表单控件尺寸
};
const AcceptanceManagerPage: React.FC<{ searchCallFun: any }> = (props) => {
    const {
        modalProps,
        setModalProps,
    } = useModel("AcceptanceManager.modal")
    const [senceList, setSenceList] = useState<any[]>([]);
    const { initialState, setInitialState } = useModel('@@initialState');
    const [evaluationReportList, setEvaluationReportList] = useState<any>([])
    const [auditReportList, setAuditReportList] = useState<any>([])
    const [acceptanceReportList, setAcceptanceReportList] = useState<any>([])
    const [invoiceReportList, setInvoiceReportList] = useState<any[]>([]);
    const [summaryReportList, setSummaryReportList] = useState<any[]>([])
    const [form] = Form.useForm()
    const handleSubmit = () => {
        form.validateFields().then(values => {
            updateProgramCheck({ ...values, id: modalProps.record.id, demandId: modalProps.record.demandId, projectId: modalProps.record.projectId }).then(res => {
                const { code } = res;
                if (code == "0") {
                    //message.success("更新产品信息成功")
                    setModalProps(prev => ({ ...prev, visible: false }))
                }
            })
        })
    };
    const convertNode = (node: any) => ({
        title: node.title,
        value: node.value,
        disabled: node.children && node.children.length > 0,
        children: node.children?.map(convertNode),
    });
    const buildFullPathMap = (
        nodes: any[],
        parentPath: string[] = [],
        map: Record<string, string[]> = {},
    ) => {
        nodes.forEach((node) => {
            const currentPath = [...parentPath, node.title];
            map[node.value] = currentPath;
            if (node.children && node.children.length) {
                buildFullPathMap(node.children, currentPath, map);
            }
        });
        return map;
    };

    const handleAutoUpload = async (file: any, formPath: any) => {

        try {
            const response = await uploadFile(file)
            if (response.code == "0") {
                if (formPath == "invoiceReport") {
                    setInvoiceReportList(prev => ([{ name: response.data.filename, uid: Math.random().toString() }]))
                } else {
                    setSummaryReportList(prev => ([{ name: response.data.filename, uid: Math.random().toString() }]))
                }
                form.setFieldValue(formPath, [response.data])

            }
        } catch (error) {
        }
    };

    const fullPathMap = buildFullPathMap(condition);
    useEffect(() => {
        form.setFieldsValue({ ...modalProps.record })
        setEvaluationReportList(modalProps.record.evaluationReport?.map((item: any) => ({...item, name: item.filename, uid: Math.random().toString() })))
        setAuditReportList(modalProps.record.auditReport?.map((item: any) => ({ ...item, name: item.filename, uid: Math.random().toString() })))
        setAcceptanceReportList(modalProps.record.acceptanceReport?.map((item: any) => ({...item,  name: item.filename, uid: Math.random().toString() })))
        setInvoiceReportList(modalProps.record.invoiceReport?.map((item: any) => ({ ...item, name: item.filename, uid: Math.random().toString() })))
        setSummaryReportList(modalProps.record.summaryReport?.map((item: any) => ({ ...item, name: item.filename, uid: Math.random().toString() })))
    }, [modalProps.record])
    const onCancel = () => {
        setModalProps(prev => ({ ...prev, visible: false }))
    }
    const onFinishFailed = (values: any) => { };

    async function handleReviewSubmit(arg0: string) {
        await form.validateFields()
        programCheck({
            auditStatus: arg0,
            auditRemark: form.getFieldValue("auditRemark"),
            companyId: modalProps.record.companyId,
            projectId: modalProps.record.projectId,
            auditUserId: initialState?.currentUser?.data.id,
            auditId: modalProps.record.auditId,
            userType: initialState?.currentUser?.data.userType,
            // auditDepartment:initialState?.currentUser?.data.departmentName
        }).then(res => {
            const { code } = res;
            if (code == "0") {
                setModalProps(prev => ({ ...prev, visible: false }))
                //message.success("操作成功")
                props.searchCallFun();
            }
        })

    }



    return (
        <Modal
            title={modalProps.title}
            open={modalProps.visible}
            onCancel={onCancel}
            footer={modalProps.title == "审核项目验收管理" ? null : [
                <Button key="back" onClick={onCancel}>
                    取消
                </Button>,
                <Button key="submit" type="primary"
                    onClick={handleSubmit}
                >
                    提交
                </Button>,
            ]}
            width={900}
            destroyOnClose
            maskClosable={false}
        >
            <Form
                {...FORM_LAYOUT}
                form={form}
            // name="basic"
            // labelCol={{ span: 8 }}
            // wrapperCol={{ span: 16 }}
            // style={{ maxWidth: '100%', paddingLeft: '20%', paddingRight: '20%' }}
            // initialValues={{ remember: true }}
            // onFinish={onFinish}
            // onFinishFailed={onFinishFailed}
            // autoComplete="off"
            // layout="vertical"
            >
                <div style={{ padding: 20, backgroundColor: '#f8f9fa', boxSizing: 'border-box' }}>
                    <div
                        style={{
                            backgroundColor: '#fff',
                            padding: 20,
                            borderRadius: 8,
                            boxShadow: '0 1px 3px rgba(0,0,0,0.05)',
                        }}
                    >
                        <div style={{ marginBottom: 24 }}>
                            <h3
                                style={{
                                    fontSize: 16,
                                    fontWeight: 500,
                                    color: '#1f2937',
                                    marginBottom: 12,
                                }}
                            >
                                数字化改造成效
                            </h3>
                            <Form.Item label="数字化水平等级(改造后)" style={{ marginBottom: 20 }}>

                                <Space.Compact style={{ width: '100%' }}>  {/* 补充布局容器，避免按钮错位 */}
                                    <Form.Item
                                        name="digitalLevel"  // 保持原name
                                        rules={[{ required: true, message: '请选择数字化水平等级' }]}
                                        noStyle
                                    >
                                        <Select
                                            style={{ ...COMMON_FIELD_STYLE, width: '90%' }}
                                            // 绑定表单值（与name对应）
                                            className={modalProps.title == "审核项目验收管理" ? 'custom-readonly-select' : ''}
                                            value={form.getFieldValue('digitalLevel')}
                                            onChange={(value) => form.setFieldValue('digitalLevel', value)}
                                        >
                                            {/* <Select.Option value="none">无等级</Select.Option> */}
                                            <Select.Option value="level1">一级</Select.Option>
                                            <Select.Option value="level2">二级</Select.Option>
                                            <Select.Option value="level3">三级</Select.Option>
                                            <Select.Option value="level4">四级</Select.Option>
                                        </Select>
                                    </Form.Item>
                                    <Button
                                        style={{ ...COMMON_FIELD_STYLE, width: '10%' }}
                                        onClick={() =>
                                            window.open(
                                                'https://ucenter.miit.gov.cn/login.jsp?toUrl=http%3A%2F%2Fzjtx.miit.gov.cn%2Fqyxx%2Fgotoszhsp',
                                            )
                                        }
                                        type="primary"
                                    >
                                        去测试
                                    </Button>
                                </Space.Compact>

                            </Form.Item>
                            <Form.Item
                                name="innovationDimension"
                                label="创新维度"
                                rules={[{ required: true, message: '请输入创新维度' }]}
                                style={{ marginBottom: 20 }}
                            >
                                <TextArea
                                    readOnly={modalProps.title == "审核项目验收管理"}
                                    maxLength={500}
                                    showCount
                                    style={{
                                        minHeight: 100,
                                        resize: 'vertical',
                                        ...COMMON_FIELD_STYLE,
                                    }}
                                />
                            </Form.Item>

                            <Form.Item
                                name="capacityDimension"
                                label="市场维度"
                                rules={[{ required: true, message: '请输入市场维度' }]}
                                style={{ marginBottom: 20 }}
                            >
                                <TextArea
                                    maxLength={500}
                                    readOnly={modalProps.title == "审核项目验收管理"}
                                    showCount
                                    style={{
                                        minHeight: 100,
                                        resize: 'vertical',
                                        ...COMMON_FIELD_STYLE,
                                    }}
                                />
                            </Form.Item>

                            <Form.Item
                                name="qualityDimension"
                                label="提质维度"
                                rules={[{ required: true, message: '请输入提质维度' }]}
                                style={{ marginBottom: 20 }}
                            >
                                <TextArea
                                    maxLength={500}
                                    readOnly={modalProps.title == "审核项目验收管理"}
                                    showCount
                                    style={{
                                        minHeight: 100,
                                        resize: 'vertical',
                                        ...COMMON_FIELD_STYLE,
                                    }}
                                />
                            </Form.Item>

                            <Form.Item
                                name="sampleDimension"
                                label="降本维度"
                                rules={[{ required: true, message: '请输入降本维度' }]}
                                style={{ marginBottom: 20 }}
                            >
                                <TextArea
                                    maxLength={500}
                                    readOnly={modalProps.title == "审核项目验收管理"}
                                    showCount
                                    style={{
                                        minHeight: 100,
                                        resize: 'vertical',
                                        ...COMMON_FIELD_STYLE,
                                    }}
                                />
                            </Form.Item>

                            <Form.Item
                                name="efficiencyDimension"
                                label="增效维度"
                                rules={[{ required: true, message: '请输入增效维度' }]}
                                style={{ marginBottom: 20 }}
                            >
                                <TextArea
                                    maxLength={500}
                                    showCount
                                    readOnly={modalProps.title == "审核项目验收管理"}
                                    style={{
                                        minHeight: 100,
                                        resize: 'vertical',
                                        ...COMMON_FIELD_STYLE,
                                    }}
                                />
                            </Form.Item>

                            <Form.Item
                                name="greenDimension"
                                label="绿色维度"
                                rules={[{ required: true, message: '请输入绿色维度' }]}
                                style={{ marginBottom: 20 }}
                            >
                                <TextArea
                                    maxLength={500}
                                    showCount
                                    readOnly={modalProps.title == "审核项目验收管理"}
                                    style={{
                                        minHeight: 100,
                                        resize: 'vertical',
                                        ...COMMON_FIELD_STYLE,
                                    }}
                                />
                            </Form.Item>

                            <Form.Item
                                name="safetyDimension"
                                label="安全维度"
                                rules={[{ required: true, message: '请输入安全维度' }]}
                                style={{ marginBottom: 20 }}
                            >
                                <TextArea
                                    maxLength={500}
                                    showCount
                                    readOnly={modalProps.title == "审核项目验收管理"}
                                    style={{
                                        minHeight: 100,
                                        resize: 'vertical',
                                        ...COMMON_FIELD_STYLE,
                                    }}
                                />
                            </Form.Item>

                            <Form.Item
                                name="otherDimension"
                                label="其他维度"
                                rules={[{ required: true, message: '请输入其他维度' }]}
                                style={{ marginBottom: 20 }}
                            >
                                <TextArea
                                    maxLength={500}
                                    readOnly={modalProps.title == "审核项目验收管理"}
                                    showCount
                                    style={{
                                        minHeight: 100,
                                        resize: 'vertical',
                                        ...COMMON_FIELD_STYLE,
                                    }}
                                />
                            </Form.Item>
                        </div>

                        <Divider />

                        {/* 投资与评价信息组 */}
                        {/* <div style={{ marginBottom: 24 }}>
            <h3
              style={{
                fontSize: 16,
                fontWeight: 500,
                color: '#1f2937',
                marginBottom: 12,
              }}
            >
              奖补资金情况
            </h3>

            <Form.Item
              name="totalInvestment"
              label={
                <div style={{ textAlign: 'left' }}>
                  拟对该企业奖补
                  <br />
                  资金总额(万元)
                </div>
              }
              style={{ marginBottom: 20 }}
            >
              <Input disabled={initialState?.currentUser?.access == "enterprise"} placeholder='待经商局填写' style={COMMON_FIELD_STYLE} />
            </Form.Item>

            <Form.Item
              name="alreadyInvested"
              label="已拨付资金 (万元)"
              style={{ marginBottom: 20 }}
            >
              <Input disabled={initialState?.currentUser?.access == "enterprise"} placeholder='待经商局填写' style={COMMON_FIELD_STYLE} />
            </Form.Item>
          </div> */}

                        <Divider />

                        {/* 服务与售后信息组 */}
                        <div style={{ marginBottom: 24 }}>
                            <h3
                                style={{
                                    fontSize: 16,
                                    fontWeight: 500,
                                    color: '#1f2937',
                                    marginBottom: 12,
                                }}
                            >
                                对所使用服务商及评价
                            </h3>
                            <Form.List
                                name="stepFiveList"
                            // initialValue={dataGlobal.stepFiveData || []} // 从数据源获取初始值，决定列表长度
                            >
                                {(fields) => (
                                    <>
                                        {fields.map((field, index) => (
                                            <div
                                                key={field.key}
                                                style={{
                                                    border: '1px solid #eee',
                                                    padding: 16,
                                                    borderRadius: 4,
                                                    marginBottom: 16
                                                }}
                                            >

                                                <Form.Item
                                                    {...field}
                                                    name={[field.name, 'dealWayName']}
                                                    label="产品以及解决方案名称"
                                                    rules={[{ required: true, message: '请输入产品以及解决方案名称' }]}
                                                    style={{ marginBottom: 20 }}
                                                >
                                                    <Input style={COMMON_FIELD_STYLE} />
                                                </Form.Item>

                                                <Form.Item
                                                    {...field}
                                                    name={[field.name, 'connectProvider']}
                                                    label="关联服务商"
                                                    rules={[{ required: true, message: '请输入关联服务商' }]}
                                                    style={{ marginBottom: 20 }}
                                                >
                                                    <Input style={COMMON_FIELD_STYLE} />
                                                </Form.Item>

                                                <Form.Item
                                                    {...field}
                                                    name={[field.name, 'evaluationScore']}
                                                    label="评价星数"
                                                    rules={[{ required: true, message: '请选择评价星数' }]}
                                                    style={{ marginBottom: 20 }}
                                                    initialValue={5}
                                                >
                                                    <Rate />
                                                </Form.Item>

                                                <Form.Item
                                                    {...field}
                                                    name={[field.name, 'totalScore']}
                                                    label="服务商评价总星级"
                                                    rules={[{ required: true, message: '请选择服务商评价总星级' }]}
                                                    style={{ marginBottom: 20 }}
                                                    initialValue={5}
                                                >
                                                    <Rate />
                                                </Form.Item>
                                            </div>
                                        ))}
                                    </>
                                )}
                            </Form.List>
                        </div>

                        <Divider />

                        {/* 报告信息组 */}
                        <div style={{ marginBottom: 24 }}>
                            <h3
                                style={{
                                    fontSize: 16,
                                    fontWeight: 500,
                                    color: '#1f2937',
                                    marginBottom: 12,
                                }}
                            >
                                附件材料
                            </h3>

                            <Form.Item
                                name="evaluationReport"
                                label="评测报告"
                                rules={[{ required: true, message: '请输入评测报告' }]}
                                style={{ marginBottom: 20 }}
                            >
                                <Upload disabled fileList={evaluationReportList}
                                onPreview={async (file: any) => {
                                        try {
                                            const filePath = file.url || file.response?.path || file.path;

                                            if (!filePath) {
                                                message.error('文件路径不存在');
                                                return;
                                            }

                                            const response = await filePreview(
                                                { path: filePath },
                                                {
                                                    responseType: 'blob', // 重要：指定响应类型为 blob
                                                    getResponse: true, // 获取完整的响应对象
                                                }
                                            );

                                            const blob = response.data;

                                            if (!blob) {
                                                message.error('文件获取失败');
                                                return;
                                            }

                                            const downloadUrl = window.URL.createObjectURL(blob);
                                            const link = document.createElement('a');
                                            link.href = downloadUrl;

                                            const fileName = file.name ||
                                                file.response?.name ||
                                                'download_' + new Date().getTime();
                                            link.download = fileName;

                                            document.body.appendChild(link);
                                            link.click();
                                            document.body.removeChild(link);

                                            window.URL.revokeObjectURL(downloadUrl);

                                            message.success('文件下载成功');

                                        } catch (error) {
                                            console.error('文件下载失败:', error);
                                            message.error('文件下载失败');
                                        }
                                    }}
                                >
                                    {evaluationReportList?.length == 0 || !evaluationReportList && "机构未上传"}
                                </Upload>
                            </Form.Item>
                            <Form.Item
                                name="invoiceReport"
                                label="发票"
                                rules={[{ required: true, message: '请输入发票' }]}
                                style={{ marginBottom: 20 }}
                            >
                                <Upload
                                    fileList={invoiceReportList}
                                    beforeUpload={(file) => {
                                        handleAutoUpload(file, "invoiceReport");
                                        return false;
                                    }}
                                    onPreview={async (file: any) => {
                                        try {
                                            const filePath = file.url || file.response?.path || file.path;

                                            if (!filePath) {
                                                message.error('文件路径不存在');
                                                return;
                                            }

                                            const response = await filePreview(
                                                { path: filePath },
                                                {
                                                    responseType: 'blob', // 重要：指定响应类型为 blob
                                                    getResponse: true, // 获取完整的响应对象
                                                }
                                            );

                                            const blob = response.data;

                                            if (!blob) {
                                                message.error('文件获取失败');
                                                return;
                                            }

                                            const downloadUrl = window.URL.createObjectURL(blob);
                                            const link = document.createElement('a');
                                            link.href = downloadUrl;

                                            const fileName = file.name ||
                                                file.response?.name ||
                                                'download_' + new Date().getTime();
                                            link.download = fileName;

                                            document.body.appendChild(link);
                                            link.click();
                                            document.body.removeChild(link);

                                            window.URL.revokeObjectURL(downloadUrl);

                                            message.success('文件下载成功');

                                        } catch (error) {
                                            console.error('文件下载失败:', error);
                                            message.error('文件下载失败');
                                        }
                                    }}
                                    listType="text"
                                    maxCount={1}
                                >
                                    {invoiceReportList?.length == 0 || !invoiceReportList && "机构未上传"}
                                    {/* <Button icon={<UploadOutlined />}>点击上传发票</Button> */}

                                </Upload>
                            </Form.Item>

                            <Form.Item
                                name="auditReport"
                                label="审计报告"
                                rules={[{ required: true, message: '请输入审计报告' }]}
                                style={{ marginBottom: 20 }}
                            >
                                <Upload disabled fileList={auditReportList}
                                onPreview={async (file: any) => {
                                        try {
                                            const filePath = file.url || file.response?.path || file.path;

                                            if (!filePath) {
                                                message.error('文件路径不存在');
                                                return;
                                            }

                                            const response = await filePreview(
                                                { path: filePath },
                                                {
                                                    responseType: 'blob', // 重要：指定响应类型为 blob
                                                    getResponse: true, // 获取完整的响应对象
                                                }
                                            );

                                            const blob = response.data;

                                            if (!blob) {
                                                message.error('文件获取失败');
                                                return;
                                            }

                                            const downloadUrl = window.URL.createObjectURL(blob);
                                            const link = document.createElement('a');
                                            link.href = downloadUrl;

                                            const fileName = file.name ||
                                                file.response?.name ||
                                                'download_' + new Date().getTime();
                                            link.download = fileName;

                                            document.body.appendChild(link);
                                            link.click();
                                            document.body.removeChild(link);

                                            window.URL.revokeObjectURL(downloadUrl);

                                            message.success('文件下载成功');

                                        } catch (error) {
                                            console.error('文件下载失败:', error);
                                            message.error('文件下载失败');
                                        }
                                    }}>
                                    {auditReportList?.length == 0 || !auditReportList && "机构未上传"}
                                </Upload>
                            </Form.Item>
                            <Form.Item
                                name="summaryReport"
                                label="企业提交总结报告"
                                rules={[{ required: true, message: '请输入企业提交总结报告' }]}
                                style={{ marginBottom: 20 }}
                            >
                                <Upload
                                    disabled={!(evaluationReportList && evaluationReportList.length != 0
                                        && auditReportList && auditReportList.length != 0)}
                                    fileList={summaryReportList}
                                    beforeUpload={(file) => {
                                        handleAutoUpload(file, "summaryReport");
                                        return false;
                                    }}
                                    onPreview={async (file: any) => {
                                        try {
                                            const filePath = file.url || file.response?.path || file.path;

                                            if (!filePath) {
                                                message.error('文件路径不存在');
                                                return;
                                            }

                                            const response = await filePreview(
                                                { path: filePath },
                                                {
                                                    responseType: 'blob', // 重要：指定响应类型为 blob
                                                    getResponse: true, // 获取完整的响应对象
                                                }
                                            );

                                            const blob = response.data;

                                            if (!blob) {
                                                message.error('文件获取失败');
                                                return;
                                            }

                                            const downloadUrl = window.URL.createObjectURL(blob);
                                            const link = document.createElement('a');
                                            link.href = downloadUrl;

                                            const fileName = file.name ||
                                                file.response?.name ||
                                                'download_' + new Date().getTime();
                                            link.download = fileName;

                                            document.body.appendChild(link);
                                            link.click();
                                            document.body.removeChild(link);

                                            window.URL.revokeObjectURL(downloadUrl);

                                            message.success('文件下载成功');

                                        } catch (error) {
                                            console.error('文件下载失败:', error);
                                            message.error('文件下载失败');
                                        }
                                    }}
                                    listType="text"
                                    maxCount={1}
                                >
                                    {summaryReportList?.length == 0 || !summaryReportList && "机构未上传"}
                                </Upload>
                            </Form.Item>
                            <Form.Item
                                name="acceptanceReport"
                                label=" 验收报告"
                                // rules={[{ required: true, message: '请输入验收报告' }]}
                                style={{ marginBottom: 20 }}
                            >
                                <Upload disabled fileList={acceptanceReportList}
                                onPreview={async (file: any) => {
                                        try {
                                            const filePath = file.url || file.response?.path || file.path;

                                            if (!filePath) {
                                                message.error('文件路径不存在');
                                                return;
                                            }

                                            const response = await filePreview(
                                                { path: filePath },
                                                {
                                                    responseType: 'blob', // 重要：指定响应类型为 blob
                                                    getResponse: true, // 获取完整的响应对象
                                                }
                                            );

                                            const blob = response.data;

                                            if (!blob) {
                                                message.error('文件获取失败');
                                                return;
                                            }

                                            const downloadUrl = window.URL.createObjectURL(blob);
                                            const link = document.createElement('a');
                                            link.href = downloadUrl;

                                            const fileName = file.name ||
                                                file.response?.name ||
                                                'download_' + new Date().getTime();
                                            link.download = fileName;

                                            document.body.appendChild(link);
                                            link.click();
                                            document.body.removeChild(link);

                                            window.URL.revokeObjectURL(downloadUrl);

                                            message.success('文件下载成功');

                                        } catch (error) {
                                            console.error('文件下载失败:', error);
                                            message.error('文件下载失败');
                                        }
                                    }}>
                                    {acceptanceReportList?.length == 0 || !acceptanceReportList && "机构未上传"}
                                </Upload>
                            </Form.Item>
                        </div>

                        {
                            modalProps.title == "审核项目验收管理" && (
                                <>
                                    {/* 审核意见（必填） */}
                                    <Divider>审核意见</Divider>
                                    <Form.Item
                                        name="auditRemark"
                                        label={
                                            <span>
                                                审核意见 <span style={{ color: 'red' }}>*</span>
                                            </span>
                                        }
                                        rules={[{ required: true, message: '请填写审核意见' }]}
                                    >
                                        <TextArea
                                            rows={4}
                                            placeholder="请输入审核意见（如：产品信息完整，同意通过；或：缺少技术规格，需退回补充）"
                                        />
                                    </Form.Item>

                                    {/* 审核操作按钮：通过/不通过/退回 */}
                                    <div style={{ display: 'flex', justifyContent: 'flex-end', gap: '16px', marginTop: '16px' }}>
                                        <Button onClick={() => setModalProps(prev => ({ ...prev, visible: false }))}>
                                            取消
                                        </Button>
                                        <Button
                                            danger
                                            icon={<CloseCircleOutlined />}
                                            onClick={() => handleReviewSubmit('rejected')}
                                        >
                                            不通过
                                        </Button>
                                        <Button
                                            icon={<SyncOutlined />}
                                            onClick={() => handleReviewSubmit('returned')}
                                        >
                                            退回
                                        </Button>
                                        <Button
                                            type="primary"
                                            icon={<CheckCircleOutlined />}
                                            onClick={() => handleReviewSubmit('approved')}
                                        >
                                            通过
                                        </Button>
                                    </div>
                                </>
                            )
                        }

                    </div>
                </div>
            </Form>
        </Modal >
    )
}

export default AcceptanceManagerPage;